10 REM ************ save as "simon.bas" ***************
20 REM *** Author - David Lorenz, Matthews NC ***
30 DEFINT A-Z
40 KEY OFF:CLS:PRINT "In order for you to observe me, you must have graphics on your computer."
50 PRINT:PRINT "Well, don't just sit there! Do you or do you not have graphics (Y/N)";:INPUT YN$:IF YN$="Y" OR YN$="y" THEN GOTO 60 ELSE IF YN$="N" OR YN$="n" THEN SYSTEM ELSE GOTO 50
60 CLS:PRINT
70 PRINT
80 PRINT "Welcome to me! My name is as it has been for many years - Simon."
90 PRINT
100 PRINT "I desire to play a game with you. A game that requires a good memory"
110 PRINT "on your part. Of course, I never forget anything and I never make eny mistakes."
120 PRINT
130 PRINT "Here's how to play the game:":PRINT
140 PRINT "My last name is 'SAYS'. Do you understand what I'm saying? (I can hardly"
150 PRINT "keep up with myself sometimes) When I display one of four colored blocks,"
160 PRINT "you should press the associated key that represents that block - either HOME,"
170 PRINT "PAGE UP, PAGE DOWN, or END. The relative positions of these keys on your IBM"
180 PRINT "keyboard are layout to look like the 4 possible blocks I will display. If you"
190 PRINT "get that one right, I will then not only display that block again but will also"
200 PRINT "display another one. Now not only do you have to press the original key, but youmust press the the key that represents the new block. The play goes on and on"
210 PRINT "until you forget the sequence of blocks. I will then show you what you missed."
220 PRINT "Even my 11 year old daughter gets in the low 20's all the time..."
230 PRINT "Now press <RTN> to (in the words of Clint Eastwood) 'Go ahead, make my play'"
240 INPUT DUMMY$
250 HAPPYDAYS$="T200MS O2L4C L8E MLL8EL4E MSG G O3L8C L4C L4C E L8C MLL4CL8C MSO2L4G msG L8E L2E"
260 DIM KEEP(99),SCORE(9),DTE$(9),YN$(9)
270 SCREEN 1:GOSUB 980
280 BGROUND=0:PALETTE=0:COLORS=1
290 EPATTERN$=CHR$(&H1) 'error pattern
300 MPATTERN$=CHR$(&HFF) 'merlins
310 YPATTERN$=CHR$(&HCC) 'your
320 COLOR BGROUND,PALETTE
330 RANDOMIZE TIMER
340 REM ---- determine computer speed -
350 CLS:PRINT " Simon is now checking to see how fast your computer is... Please wait."
360 TIME1!=TIMER
370 FOR A=0 TO 9999:NEXT
380 TIME2!=TIMER
390 DL#=4.12/(TIME2!-TIME1!)*1500
400 IF DL#>32767 THEN DL#=32767
410 INPUT "Please give Simon your name...",YOURNAME$
420 REM ---------------------------------
430 CLS:J=-1:DEL=DL#
440 LOCATE 1,10:PRINT "Welcome to Simon!";
450 LOCATE 1,37:PRINT PRECORD;
460 LOCATE 3,6:PRINT "Home";
470 LOCATE 3,28:PRINT "PgUp";
480 LOCATE 23,6:PRINT "End";
490 LOCATE 23,28:PRINT "PgDn";
500 LOCATE 24,10:PRINT "Simon's turn ";
510 LINE (50,25)-(240,175),2,B
520 DRAW "m-095,0 u150 bm-95,75 r190 bm-95,0"
530 PATTERN$=MPATTERN$
540 CHOICE=INT(RND*4)
550 J=J+1:KEEP(J)=CHOICE
560 FOR K=0 TO J:CHOICE=KEEP(K):DEF SEG=0:POKE 1050,PEEK(1052):GOSUB 770:NEXT
570 L=-1:LOCATE 24,10:PRINT "Your turn to try"J+1;
580 PATTERN$=YPATTERN$:DEL=0
590 WHILE L<J
600 PRESS$=INKEY$:IF PRESS$="" OR LEN(PRESS$)<>2 GOTO 600
610 L=L+1
620 KEYED=ASC(RIGHT$(PRESS$,1))
630 CHOICE=9
640 IF KEYED=81 THEN CHOICE=0 'PgDn
650 IF KEYED=79 THEN CHOICE=1 'End
660 IF KEYED=71 THEN CHOICE=2 'Home
670 IF KEYED=73 THEN CHOICE=3 'PgUp
680 IF CHOICE=9 THEN GOTO 600
690 GOSUB 770
700 IF CHOICE<>KEEP(L) THEN DEL=DL#:SOUND 80,50:GOTO 870
710 LOCATE 24,20:PRINT L+2 "out of" J+1;
720 WEND
730 DEL=DL#
740 LOCATE 24,10:PRINT "Simon's turn ";
750 FOR I=0 TO 3*DEL:NEXT
760 GOTO 530
770 REM -------------------------------
780 ON CHOICE+1 GOTO 790,810,830,850
790 PAINT STEP (40,40),PATTERN$,2:DRAW "bm-40,-40":SOUND 523,10:FOR I=0 TO DEL:NEXT
800 PAINT STEP (40,40),0,2:DRAW "bm-40,-40":FOR I=0 TO DEL:NEXT:RETURN
810 PAINT STEP (-40,40),PATTERN$,2:DRAW "bm+40,-40":SOUND 659,10:FOR I=0 TO DEL:NEXT
820 PAINT STEP (-40,40),0,2:DRAW "bm+40,-40":FOR I=0 TO DEL:NEXT:RETURN
830 PAINT STEP (-40,-40),PATTERN$,2:DRAW "bm+40,+40":SOUND 784,10:FOR I=0 TO DEL:NEXT
840 PAINT STEP (-40,-40),0,2:DRAW "bm+40,+40":FOR I=0 TO DEL:NEXT:RETURN
850 PAINT STEP (40,-40),PATTERN$,2:DRAW "bm-40,+40":SOUND 1046,10:FOR I=0 TO DEL:NEXT
860 PAINT STEP (40,-40),0,2:DRAW "bm-40,+40":FOR I=0 TO DEL:NEXT:RETURN
870 REM --------------------------
880 IF J>PRECORD THEN PRECORD=J
890 DEL=0
900 LOCATE 24,10:PRINT "Here's the correct way! ";
910 FOR K=0 TO J:CHOICE=KEEP(K)
920 IF K=L THEN DEL=DL#:PATTERN$=EPATTERN$ ELSE DEL=0:PATTERN$=MPATTERN$
930 GOSUB 780:NEXT
940 GOSUB 1190
950 LOCATE 11,8:PRINT "You got " L "right out of " J+1
960 LOCATE 12,8:INPUT "Wanna play again? (y/n)",YN$
970 IF YN$="y" OR YN$="Y" THEN GOTO 430 ELSE IF YN$="n" OR YN$="N" THEN SYSTEM ELSE GOTO 960
980 REM ------------ Display Score History ----------------